package com.javaee.term.service.iml;

import com.javaee.term.data.ConverAnaly;
import com.javaee.term.data.TurnOver;
import com.javaee.term.model.Customer;
import com.javaee.term.model.Product;
import com.javaee.term.service.CustomerService;
import com.javaee.term.service.ProductService;
import com.javaee.term.service.base.BaseServiceIml;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author 陈伯瑞
 * date 2019/12/16 0016 23:29
 * version 1.0
 **/
@Service
public class CustomerServiceIml  extends BaseServiceIml implements CustomerService {
    @Override
    public Customer findOne(Object id) {
        return customerMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Customer> findAll() {
        return customerMapper.selectAll();
    }

    @Override
    public void delete(Object id) {
       customerMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Customer customer) {
        return customerMapper.insert(customer);
    }

    @Override
    public int update(Customer customer) {
        return customerMapper.updateByPrimaryKey(customer);
    }

    @Override
    public List<TurnOver> getAllCustomerTurnOver() {
        return customerMapper.getAllCustomerTurnOver();
    }
}
